<?php
// Step 1: Check to see if the application environment is already setup
if (isset($bootstrap) && $bootstrap){
	// Step 1a: Add our library directory to the include path so that
	// PHP can find the Zend Framework classes
	set_include_path('../library' . PATH_SEPARATOR . get_include_path());
	
	// Step 1b: Set up autolaod.
	// This is a nifty trick that allows ZF to load classes automatically so that
	// you don't have to litter your code with 'include' or 'require' statements.
	require_once "Zend/Loader.php";
	Zend_Loader::registerAutoload();
}

// Step 2: Get the fron controller.
// The Zend_Front_Controller class implements Singleon pattern, which is a
// design pattern used to ensure there is only instance of 
// Zend_Front_Controller created on each request.
$frontController = Zend_Controller_Front::getInstance();

// Step 3: Point the front controller to your action controller directory.
$frontController->setControllerDirectory('../applications/controllers');

// Step 4: Set the current environment
// Set a variable in the front controller indicating the currnet environment--
// commonly one of development, staging, testing, production, but wholly
// dependent on your organization and site's needs.
$frontController->setParam('env', 'development');
